<?php
namespace app\admin\validate;
use think\facade\Db;
use think\Validate;

class AdminRole extends Validate
{

    protected $rule=[
        'role_name'    =>'require|unique:admin_role',
        'role_id'    =>'require',
    ];
    protected $message = [
        'role_name.require'    => '请输入角色名称',
        'role_name.unique'     => '已存在相同角色名称',
        'role_id'               =>'关键参数不能为空'
    ];
    protected $scene = [
        'add' =>['role_name'],
        'edit'=>['role_name','role_id'],
        'del' =>['role_id'],
    ];

}